package com.key.win.business.meeting.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.key.win.base.enumjson.TextureEnumSerializerCode;
import com.key.win.business.meeting.vo.MtRecordingVo;

@JsonSerialize(using = TextureEnumSerializerCode.class)
public enum MtRecordingTypeEnum {
    AUDIO_VIDEO(0, "音视频"),
    VIDEO(1, "仅视频"),
    AUDIO(2, "仅音频"),
    IMAGE(3, "图片"),
    TEXT(4, "图片"),
    OTHER(5, "其它");

    @EnumValue
    private int code;
    private String text;

    private MtRecordingTypeEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }


    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static MtRecordingTypeEnum getMtRecordingTypeEnum(MtRecordingVo mtRecording) {
        if (mtRecording.isHasVideo() && mtRecording.isHasAudio()) {
            return AUDIO_VIDEO;
        } else if (mtRecording.isHasVideo()) {
            return VIDEO;
        } else if (mtRecording.isHasAudio()) {
            return AUDIO;
        } else if (mtRecording.isHasImage()) {
            return IMAGE;
        } else {
            return OTHER;
        }
    }
}
